package com.ibm.corebanking.idmf.dubbo.client.annotation;

import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;

import com.ibm.corebanking.idmf.dubbo.client.MultiServiceCodeResolver;


/**
 * 用于标记本接口是一个用于访问服务的客户端接口，技术平台框架将处理本注解，根据配置，生成相应的客户端代理，如FeignClient、Dubbo
 * Reference等
 * 
 * @author WeiZhou
 *
 */
@Target(TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IdmfDubboClient {
	/**
	 * The name of the service with optional protocol prefix. Synonym for
	 * {@link #name() name}. A name must be specified for all clients, whether or
	 * not a url is provided. Can be specified as property key, eg: ${propertyKey}.
	 * 
	 * @return the name of the service with optional protocol prefix
	 */
	@AliasFor("name")
	String value() default "";


//	/**
//	 * This will be used as the bean name instead of name if present, but will not
//	 * be used as a service id.
//	 * 
//	 * @return bean name instead of name if present
//	 */
//	String contextId() default "";

	/**
	 * @return The service id with optional protocol prefix. Synonym for
	 *         {@link #value() value}.
	 */
	@AliasFor("value")
	String name() default "";


	/**
	 * @return an absolute URL or resolvable hostname (the protocol is optional).
	 */
	String url() default "";


	/**
	 * @return whether to mark the feign proxy as a primary bean. Defaults to true.
	 */
	boolean primary() default true;

	/**
	 * @return 用于对多服务切分定位的 {@link MultiServiceCodeResolver}实现
	 */
	Class<? extends MultiServiceCodeResolver> serviceCodeResolver() default MultiServiceCodeResolver.class;

}
